import api from '../index'

export default {
  /**
   * 新增议题
   */
  create: (data: SubjectApiTypes.create) => api.post<number>(`/meeting/${data.meeting.id}/subject`, data),

  /**
   * 修改议题
   */
  update: (data: SubjectApiTypes.create) => api.put<number>('subject', data),

  /**
   * 临时更新人员信息
   */
  tempUpdate: (data: SubjectApiTypes.tempUpdate) => api.post('subject/temp', data),

  /**
   * 删除议题
   */
  delete: (id: number) => api.delete<number>(`subject/${id}`),

  /**
   * 开始一个议题
   */
  start: (id: number) => api.put(`/subject/${id}/status/1`),

  /**
   * 结束一个议题
   */
  finish: (id: number) => api.put(`/subject/${id}/status/2`),
}
